<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/view/main/stylesheet.jsp"%>
<link rel="stylesheet" type="text/css" href="${baseurl}/styles/frameword/css/list.css" />
<script src="${baseurl}/styles/frameword/js/list.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(function() {
		var url = "/pro-map-advertising/";
		var tableId = "table1";
		var columns = [
			{
				field : 'adverSlogan',
				title : '广告语'
			},
			{
			field : 'promotionNumber',
			title : '推广人数'
		},
		{
			field : 'promotionExpenses',
			title : '推广费用(元)',
			formatter : function(value, row, index) {
				return (value / 100).toFixed(2);
			}
		},
		{
			field : 'promotionDistance',
			title : '推广距离(米)'
		},
		{
			field : 'addTime',
			title : '创建时间',
			formatter : function(value, row, index) {
				return format(new Date(value), 'yyyy-MM-dd hh:mm:ss');
			}
		},
				{
					field : 'operate',
					title : '操作',
					align : 'center',
					events : {
						'click .BtnOfDetails' : function(e, value, row, index) {
							layer.confirm('确定通过审核吗?', {
								btn : [ '通过', '取消' ]
							}, function() {
								$.get(baseUrl + url+"underReview/pass/" + row.primaryKey ,
										function(result) {
											if (result) {
												$("#" + tableId)
														.bootstrapTable(
																'refresh');
												layer.msg('已通过审核', {
													icon : 1,
													time : 1000
												});
											}
										}, "json");
							}, function() {
								layer.closeAll('dialog');
							});
						}
					},
					formatter : function(value, row, index) {
						return [ '<span class="BtnOfDetails pointer glyphicon glyphicon-list" style="margin-right:15px;">通过审核</span>' ]
								.join('');
					},
				} ];
		initListDefault(url, columns)
	})
</script>
</head>
<body class="container-fluid">
	<form class="bs-example bs-example-form" role="form" id="form1">
		<input type="hidden" name="state" value="underReview">
		<table class="table noline">
			<tbody>
				<tr>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">广告语</span> <input type="text" name="adverSlogan" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: right;">
						<div class="btn-group">
							<button type="button" class="btn btn-info" id="search-button">
								<i class="glyphicon glyphicon-search"></i> 搜索
							</button>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<table id="table1">
	</table>
</body>

</html>